import request from '@/utils/request'
import type {LoginParamsType} from "@/types/user";

export default {
    accountLogin: (data: LoginParamsType) => request({
        url: '/api/sum.user.user/login',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            loadingMsg: '登录中',
        },
    }),
    // 获取用户信息
    profileApi:()=>request({
        url: '/api/sum.user.user/info',
        method: 'GET',
        custom: {
            auth: true,
            showLoading: false,
        },
    }),
    // 修改用户信息
    updateApi:(data:any)=>request({
        url: '/api/sum.user.user/update',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            auth: true,
        },
    }),
    // 绑定、更换手机号
    changeMobileApi:(data:any)=>request({
        url: '/api/sum.user.user/changeMobile',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            loadingMsg: '验证中',
        },
    }),
    // 修改密码
    changePasswordApi:(data:any)=>request({
        url: '/api/sum.user.user/changePassword',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            loadingMsg: '验证中',
        },
    }),
    // 重置密码
    resetPasswordApi:(data:any)=>request({
        url: '/api/sum.user.user/resetPassword',
        method: 'POST',
        data,
        custom: {
            showSuccess: true,
            loadingMsg: '验证中',
        },
    }),
}